function exit(){
	  layui.use( 'laydate', function(){
		  var layer = layui.layer;
		  layer.closeAll();
	  });
	 
}
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,laydate = layui.laydate
  ,layer = layui.layer
  ,layedit = layui.layedit;
  
  
 
   
  
 
   
  var url="../../listenRawstock/findRawstock.action";
  var data=null;
  $.post(url,data,function(mes){
	  $.each(mes.data,function(i,item){
		   
			  $("#rawstockId").append("<option value="+item.rawstockId+">"+item.rawstockName+"</option>")
			  load();
		  
	  })
  },"json")
 
  
  $("#sub").click(function(){
	  var url="../../listenRawstockStock/addOrUpdate.action";
	  var data={"rawstockName":$("#rawstockId").find("option:selected").text(),"rawstockId":$("#rawstockId").val(),"rawstockNumber":$("#rawstockNumber").val(),"rsId":$("#rsId").val()};
	  $.post(url,data,function(mes){
		  if(mes>0){
			 var index=parent.layer.getFrameIndex(window.name);
			 parent.layer.close(index);
		  }
	  },"json")
  });
  
 
});
layui.use('upload', function(){
	  var $ = layui.jquery
	  ,upload = layui.upload;
	  
	  
	
});
function load(){
	var form = layui.form;
	form.render();
}